package com.whc.gulimall.order.config;

import com.whc.gulimall.order.interceptor.OrderInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * 自定义订单模块web配置
 *
 * @author angaoen
 */
@Configuration
public class OrderWebConfig implements WebMvcConfigurer {

    /**
     * 自定义订单模块拦截器
     */
    @Resource
    private OrderInterceptor orderInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(orderInterceptor).addPathPatterns("/**");
    }

}
